package com.ruoyi.system.service.module.property.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.system.domain.module.property.PropertyFeeOrderInfo;
import com.ruoyi.system.mapper.module.property.PropertyFeeOrderInfoMapper;
import com.ruoyi.system.service.module.property.IPropertyFeeOrderInfoService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 物业费相关费用明细Service业务层处理
 *
 * @author ruoyi
 * @date 2022-07-16
 */
@Service
public class PropertyFeeOrderInfoServiceImpl extends ServiceImpl<PropertyFeeOrderInfoMapper, PropertyFeeOrderInfo> implements IPropertyFeeOrderInfoService {

	@Resource
	private PropertyFeeOrderInfoMapper orderInfoMapper;

	@Override
	public PropertyFeeOrderInfo getOrderInfoByType(Long orderId, String feeType) {
		QueryWrapper<PropertyFeeOrderInfo> qw = new QueryWrapper<>();
		qw.eq("order_id",orderId);
		qw.eq("fee_type",feeType);
		qw.last("limit 1");
		return orderInfoMapper.selectOne(qw);
	}
}
